<?php

namespace App\Http\Controllers;

use GuzzleHttp\Client;
use Illuminate\Http\Request;

class WechatController extends Controller
{
    //

    public function receive()
    {
        $client = new Client();
        try {
            $data = ['data'=>json_encode(['type'=>'100','message'=>'别的嘚瑟了赶紧去读经','to_wxid'=>'17766203191@chatroom','robot_wxid'=>'wxid_jb6ld4goptbm22'])];
            $res =  $client->post('http://home.iceqi.club:1987/send',$data);

        } catch (\Throwable $th) {
            return response()->json($th->getMessage());
        }
        

        return response()->json($res->getBody()->getContents());
    }
}
